﻿CREATE TABLE [dbo].[Entity_Dog] (
    [ID]                  UNIQUEIDENTIFIER CONSTRAINT [DF_Entity_Dog_ID] DEFAULT (newid()) ROWGUIDCOL NOT NULL,
    [GroupID]             INT              NULL,
    [IsActive]            BIT              NULL,
    [IsDelete]            BIT              NULL,
    [IsIntake]            BIT              NULL,
    [IntakeID]            UNIQUEIDENTIFIER NULL,
    [Name]                NVARCHAR (50)    NULL,
    [MicrochipID]         NVARCHAR (75)    NULL,
    [MicrochipVendorID]   UNIQUEIDENTIFIER NULL,
    [ShelterAnimalID]     NVARCHAR (50)    NULL,
    [ShelterID]           UNIQUEIDENTIFIER NULL,
    [TattooID]            NVARCHAR (50)    NULL,
    [RegistrationID]      NVARCHAR (50)    NULL,
    [RabiesID]            NVARCHAR (25)    NULL,
    [OtherID]             NVARCHAR (50)    NULL,
    [DateIntake]          DATE             NULL,
    [IntakeFromID]        INT              NULL,
    [InitialActivityID]   INT              NULL,
    [GenderID]            CHAR (3)         NULL,
    [DateOfBirth]         DATE             NULL,
    [BreedID]             INT              NULL,
    [BreedSecondID]       INT              NULL,
    [IsMix]               BIT              NULL,
    [SizeID]              INT              NULL,
    [Weight]              DECIMAL (6, 2)   NULL,
    [ColorID]             INT              NULL,
    [IsAdoptionReady]     BIT              NULL,
    [IsSpecialNeeds]      BIT              NULL,
    [TimestampLastModify] DATETIME         NULL,
    [SpecialNeedsNotes]   NVARCHAR (MAX)   NULL,
    [Description]         NVARCHAR (MAX)   NULL,
    [Biography]           NVARCHAR (MAX)   NULL,
    CONSTRAINT [PK_Entity_Dog] PRIMARY KEY CLUSTERED ([ID] ASC),
    CONSTRAINT [FK_EntityDogIntake_ID__EntityDog_IntakeID] FOREIGN KEY ([IntakeID]) REFERENCES [dbo].[Entity_DogIntake] ([ID]),
    CONSTRAINT [FK_EntityOrganisation_ID__EntityDog_MicrochipVendorID] FOREIGN KEY ([MicrochipVendorID]) REFERENCES [dbo].[Entity_Organisation] ([ID]),
    CONSTRAINT [FK_EntityOrganisation_ID__EntityDog_ShelterID] FOREIGN KEY ([ShelterID]) REFERENCES [dbo].[Entity_Organisation] ([ID]),
    CONSTRAINT [FK_EnumBreed_ID__EntityDog_BreedID] FOREIGN KEY ([BreedID]) REFERENCES [dbo].[Enum_Breed] ([ID]),
    CONSTRAINT [FK_EnumBreed_ID__EntityDog_BreedSecondID] FOREIGN KEY ([BreedSecondID]) REFERENCES [dbo].[Enum_Breed] ([ID]),
    CONSTRAINT [FK_EnumHuskyColor_ID__EntityDog_ColorID] FOREIGN KEY ([ColorID]) REFERENCES [dbo].[Enum_HuskyColor] ([ID]),
    CONSTRAINT [FK_EnumHuskySize_ID__EntityDog_SizeID] FOREIGN KEY ([SizeID]) REFERENCES [dbo].[Enum_HuskySize] ([ID]),
    CONSTRAINT [FK_EnumInitialActivity_ID__EntityDog_InitialActivityID] FOREIGN KEY ([InitialActivityID]) REFERENCES [dbo].[Enum_InitialActivity] ([ID]),
    CONSTRAINT [FK_EnumIntakeFrom_ID__EntityDog_IntakeFromID] FOREIGN KEY ([IntakeFromID]) REFERENCES [dbo].[Enum_IntakeFrom] ([ID])
);

